//
//  FQDThirdLoginView.m
//  FakeQDaily
//
//  Created by mewxiv on 9/10/16.
//  Copyright © 2016 Xensius. All rights reserved.
//

#import "FQDThirdLoginView.h"
#import "FQDThirdLoginButton.h"

@interface FQDThirdLoginView ()

// “第三方账号登录”标题
@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation FQDThirdLoginView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self prepareUI];
    }
    return self;
}

- (void)prepareUI
{
    CGFloat buttonX = 0, buttonY = 12.0f;
    CGSize buttonSize = CGSizeMake(80.0f, 95.0f);
    UIImage *wechatImage = [UIImage imageNamed:@"wechat"];
    FQDThirdLoginButton *wechatButton = [FQDThirdLoginButton loginButton];
    [wechatButton setImage:wechatImage forState:UIControlStateNormal];
    [wechatButton setTitle:@"微信" forState:UIControlStateNormal];
    wechatButton.frame = CGRectMake(buttonX, buttonY, buttonSize.width, buttonSize.height);
    [self addSubview:wechatButton];
    buttonX += buttonSize.width;
    
    UIImage *weiboImage = [UIImage imageNamed:@"weibo"];
    FQDThirdLoginButton *weiboButton = [FQDThirdLoginButton loginButton];
    [weiboButton setImage:weiboImage forState:UIControlStateNormal];
    [weiboButton setTitle:@"微博" forState:UIControlStateNormal];
    weiboButton.frame = CGRectMake(buttonX, buttonY, buttonSize.width, buttonSize.height);
    [self addSubview:weiboButton];
    buttonX += buttonSize.width;
    
    UIImage *qqImage = [UIImage imageNamed:@"QQLogin"];
    FQDThirdLoginButton *qqButton = [FQDThirdLoginButton loginButton];
    [qqButton setImage:qqImage forState:UIControlStateNormal];
    [qqButton setTitle:@"QQ" forState:UIControlStateNormal];
    qqButton.frame = CGRectMake(buttonX, buttonY, buttonSize.width, buttonSize.height);
    [self addSubview:qqButton];
    
}

@end
